/**
 * Created by lvlq on 16/3/12.
 */
var Sequelize = require("sequelize");
var sequelize = Util("sequelize");

module.exports = sequelize.define("record", {
    openid: {
        type: Sequelize.STRING,
        field: "openid",
        allowNull: false,
        defaultValue: "",
        comment: "用户id"
    },
    pid: {
        type: Sequelize.INTEGER,
        field: "pid",
        allowNull: false,
        defaultValue: 0,
        comment: "奖品id"
    },
    pname: {
        type: Sequelize.STRING,
        field: "pname",
        allowNull: false,
        defaultValue: "",
        comment: "奖品name"
    },
    oid: {
        type: Sequelize.STRING,
        field: "oid",
        allowNull: false,
        defaultValue: "",
        comment: "点赞用户id"
    },
    today: {
        type: Sequelize.INTEGER,
        field: "today",
        allowNull: false,
        defaultValue: 0,
        comment: "奖品id"
    }
}, {
    indexes: [
        {
            fields: ["openid"]
        }
    ]
});